﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace PayloadTracker
{
    /// <summary>
    /// Simple coordinate bounding box.
    /// </summary>
    public class BoundingBox 
    {
        Coordinate m_UL;
        Coordinate m_LR;

        public double North 
        {
            get { return m_UL.Lat; }
        }
        public double West
        {
            get { return m_UL.Long; }
        }
        public double South
        {
            get { return m_LR.Lat; }
        }
        public double East
        {
            get { return m_LR.Long; }
        }


        public PayloadTracker.Coordinate UL
        {
            get { return m_UL; }
            set { m_UL = value; }
        }
        public PayloadTracker.Coordinate LR
        {
            get { return m_LR; }
            set { m_LR = value; }
        }
        public double GetLatSpan()
        {
            return Math.Abs(North - South);
        }
        public double GetLongSpan()
        {
            return Math.Abs(East - West);
        }

        public BoundingBox(Coordinate UL, Coordinate LR)
        {
            m_UL = UL;
            m_LR = LR;
        }
        public BoundingBox(double North, double East, double South, double West)
        {
            m_UL = new Coordinate(North,West);
            m_LR = new Coordinate(South,East);
        }


    }
}
